<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <canvas id="canvas" width="500px" height="500px"></canvas>
    <script>
        let mycan = document.getElementById("canvas");
        let ctx = mycan.getContext("2d");
        ctx.fillStyle = "green";
        ctx.fillRect(10, 10, 150, 100);
        ctx.fillStyle = "yellow";
        ctx.fillRect(100, 100, 150, 100);

        ctx.strokeRect(10, 10, 150, 100)
        ctx.strokeRect(100, 100, 150, 100)
        ctx.clearRect(20, 50, 80, 60)
        ctx.fillStyle = "blue";
        ctx.fillRect(300, 300, 100, 100);
        ctx.clearRect(325, 325, 50, 50)
        ctx.strokeRect(330, 330, 40, 40)

    </script>
</body>

</html>